#!/bin/bash

case "$1" in

        start)
                nohup java -jar /opt/jen-space/*.jar > boot.log 2>&1 &
                echo $! > /opt/jen-space/boot.pid
                echo "===start===="
                ;;

        stop)
		if [ -f "/opt/jen-space/boot.pid" ]; then
			kill -9 `cat /opt/jen-space/boot.pid`
               		rm -rf /opt/jen-space/boot.pid
               		echo "=====stop====="
		fi
               	# kill -9 `cat /opt/jen-space/boot.pid`
               	# rm -rf /opt/jen-space/boot.pid
               	# echo "=====stop====="
                ;;

        restart)
                $0 stop
                sleep 2
                $0 start
                echo "======restart====="
                ;;

esac
exit 0
